addign minors fitures, and cleaning code