tightening up code