deleted unnecessary files, implemented whole query