Implement height function.