implemented scott's suggestions