added database functions to get values
merging
minor changes