first draft of ESS Script (to be synced with nmpm1)