added addPin fuction