Redid movement function for units