Restructured the program

Reset the pin variables, and minor changes. Restructured the program in directories.