Changed file handler to use std::endl instead of newline char