got rid of begin-loop declaration
changed a case issue
completed crappy loop function with stackoverflow. Hooray