database functionality added

still needs work