Working on Z positioning. Refactoring it now
Implemented z positioning