a minimalist implementation of level-sublevel