added flatten method