Rearrange click function