getHeight method revised