cloned from quickstart for pagoda