Start review: fix comment style
getting rid of local variables in favor of directly assigning them
fix frame being a global variable and spacing in while loop
tested and ready