Updated the advanced version to use databases