script cleaned up