added some comments
changed return type of getHeight functions