Revamped Database to be compatible with Objective-C