Added purgeDatabase method and comments