updated pin names & changed sampling method