changed moveentity to take a pointer rather than reference and subsequent changes necessary