Main added, some work on db controller