made a few critical changes