fixed bugs in resolution algorithm