logic-1 add near_ten
logic-1 tidy up code