new functions added, and acess to database changed