Promise library - my implementation