added more functionality--DB connectivity and internal level relationship design