bug fixes and pins

Fixed bugs and added pins