Change and update source code, add database query files