cleaned up the code considerably, created one file as main and another file with all of the utilities