Fixed fgets problem, still have doubts why it didn't work the other way
fixed the bug, fgets didn't take enough chars from line, and the next fgets read an empty line