add idea and flatmap stuf