argument parsing edited and some bugs with memeory allocation and sweep functionality fixed