adds tryResolve, adds to and improves unit tests