there he wrote the longest manuscript from the middle ages the flateyjarbok