started converted c code to go