simplified line 210 per nicks suggestion