Tidied code, also fixed obc.ks.max.simp