optimal prime is now a stack