Added changes suggested by Greg and Trevor