Cleaned up more stuff and also incorporated user input of periodicity, radius, etc etc.