fixed bugs in waterclarity algorithm. Still may be more...