trying to resolve problem with when to print }