adding pin testing code