Updated to used getline() from stdio.h