fixed some argc and argv mistakes. Split code regarding argv number.