added collision and key movement