Changed: usage of case instead of if-else, removed typos