first working rej-sampling albeit without going through classes