tightened up code.