changed format from endl and fixed minor compile errors