simplified gbt logic and added more tests
jkbradley formatting suggestions