Modularized code, added command line args and dynamic arrays