finished database functionality and added command pattern to the project