added sc.stop() at end