now a working promise generator