Renamed variables, moved pin init to new fn