Fixes for calculating the direction
UI stuff