countermode / fixed issues / cleaned code