Polished both scipts