Renamed lastDirection to direction (for real)