reworked render functions
moved functions around and reworked process resume function