Missed ',' resulting in a syntax error
Added comments, adjusted spacing, fixed some bugs, code is 100% functional