added z-component from existing scene (still buggy)
fixed minor bugs and removed debug printfs