slight modification of spec to clean up code