improved handling of bottom

not ready for review yet
no, it's good