added functionality for query strings from project 2 and shortened