removed the nested if's in favor of a simple switch statement