changed to 2 pin implementation