add direction for spaceship, and a few util methods