Modified code to allow for generation of multiple pw in a range of sizes.