code combat #4 solution updated with reflection