Added arg parsing. Next step is better memory management