Rearranged Database, added tracing