Rebased on the latest version of anonymous script