implemented join on array