Updated with suggestions from Pete