Added database script to repository, finished both methods. Refactor and test.