Implemented search function, removed default if/else statement