Updated to use in-memory database