A drastically more elegant solution to the last commit.
full working readin (coarse - fine verified)
Beautification and cleanup