implemented avatar direction and speed control