handle readK, addK, if