my alg solution