full rewrite of job 5 by Cellix