starting to work out this database thing