debug assignment

completed debug v3 assignment and fixed database.js