added flatten