refactored mysql queries, added to readme file