fix #17

added padding and a function to get the depth of nodes