added main

Created the main function for the final working code.