Added PinState to better express its function