added a quiet option and fixed a few bugs