a Promise A+ implementation