working stuff
minor fixes in frame logic and syntax