worked on database. can now get data. need to add save history function