added eventlistner and a function to preform the movement