started seriously working on tone mapping algorithm -- several base sub routines implemented