logic magic