Added switch statement and basic logic