added logical way to order pins