User-friendly version of the code implemented by Arlindo.