modified to support golang