some ugly code which basically just tests out how to do this in go