solutions in golang, 4-6