The code for drawscreen fixed it but worked fine with using the $_maxrows and $height. I needed this part because I wanted a empty line between the options and the bottom of the box.

Probably should also note, in case anyone else want to use this one to remove the cls code at the begining of the script, if you want to display anything else than the menu itself.