fix HIDIOUS Jim's code