Added Q-promises to the solving algoritym