Refactored code, Completed BustTerminal Window and Fixed SQL error in db.js