add incrementAndRead and improve code
simplify example