more error checking and moving up
commented out heights