added commented code from popco1