Made output adjustments and main method adjustments.  Corrected mathematical errors and added some comments.