updated updateHeight method, don’t know if its right