This one works

Haven't checked for runtime errors, but it compiles.