smoothed out the resolve function to bubble down and back correctly, smoothing of some other rough code