incorporated Glen's changes