Update bg.max.R

Some style fixes