FIX: use flatten not flat for axes