dealt with overflow issue
merged
switched demo database code to helper