updated with peters suggestions