implementing database methods