added a system.pause at the end to be able to inspect the results