calendar script slightly modified