availHeight might become a negative value which results in a ZeroDivisionError