made some changes to view and added some db stuff