replaced print with assertion; clean up brackets