Added code comments. Modified method Resolve.