first attempt at promises...doesn't feel optimized