add var wParentHeight and also add else if statement