HUGE logic improvement