Script cleanup. Ready for testing