code cleanup and messing with depth