added restricted version of pop code