First commit. Made saving costs to db.