changed per dnet's suggestions