Initial code for promises
Merge