switched byzantine if statements for cleaner case statmements.