changes to make the program save to and read from DB