figured out how to halt in sinatra, managed to simplifiy a few lines of code