added joels code