incorperating database, still needs testing