Added flags -s, and -q. Better comments. Implementation and testing slightly improved.