script functions added, script date compare