Added writing pose to file