improve task a little more with some general logging, remove a for loop and an 'or', etc