code format improved
removed external dependency to icgtools