add state variable to Pin class