Cleaned up the really long if statement