- simplified some of the promises code and added some test cases