Implemented processing of the whole data row.
Added iterating function, allows to perform provided number of iterations.
A bit of refactoring
Added main function. Module can be run as a script.