wrote the move particle function, not tested yet