formatted the write statments in eig and output