modified height set function to be generic