moved map function to pigSqrMap