-test g -> kg ranges and add unit tests to cover this.
-remove some unused functions