cleaned up and added outfile beformat
fixed bedformat