Mostly commented code.
Works best so far.