movement with collision detection
final version(OMG)