Finalized/cleaned up the code in both files.