Implemented alignment creation.
Moved some stuff around