Source code organising, directions are calculated correctly.