Works in all directions. Major refactoring.

TODO:// Extract to seperate file. Create initiation function.