incorporating @nchron's suggestions