implement x,y,z and auto grid mode

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>