Changed getline to mgetline