added beta reduction