Found much simpler way to deal with incorr. input

Just ask the user to make sure all coordinates have 6 values.
Made count and closing files better
Merge pull request #2 from vdveen/simplified

Simplified