bar misuse of task variables (fixes #348)
reformat
clean up imports