simplify code, and update readme