simplify code & more comments
tiny fix