latest changes to control output and bug fixes