add click event and computation