merged resolution from BrunoI fork

Updated manually from github since merging was a pain. In the future we shoud force branch synch to master before accepting pull requests