flatten method is officially working!