Simple algorithms implemented in Go