Almost finished with Task 2 (except pattern query)