Cleaned up

Cleaned up a few mistakes, and turned that huge if else statement in to
a case statement. I don’t know what I was thinking when I originally
used all those if statements.

At the least its rendering now. Will have to go back and figure out
what’s wrong with the data later.