implement some algorithms with go