function inproved that finds the offset in y.
the offset get is now partially proscesed by the output file writer. Sometimes is still a pixel of.
change inread order. Now image is upward in array.
cleaned up the code and start with adding of comments.

also a loop is added to fine the offset in the x axis. Negative values have still to be inplemented
started with adding a wider range to find a overlap. Still not all overlap posibilities can be found. More think work needed.
last changes