added pins and fixed errors