implemented each & map