modified madchencontroller script