drawFrame function. puh.