hans' updated code
hans' updated round 2