Cleaned up the if statement tree that was annoying me.