major edit and improvement