Implemented recursive height method