@nottingham82 excellent advices. Works like a charm now. Thanks a lot bro. There are still some minor inaccuracies but that should not be a big deal. I'll fine tune it later.
For those who have similar issue once you key in a wrong command then end up losing all the axis, what I did is to reflash the firmware and reset the numbers (ie 400.000; 500.000 etc) then reconnect the machine, you will have them back.