code tidy by bobob