Added macro to remove newline grabbed by fgets. Used fgets to avoid buffer overflow attack