working on undo and database
Implemented preloading of Core Data database