updated code combat solution