move and kill function