Removed an unused variable
Removed an obsolete step
Removed reference to simplify code in space.cpp
Removed an obsolete function
A lot of tidying