refactored databasehelper, hooked up event edit