milestones 30,and 31: closing connection and implemented the query function.