Added unit testing, and finalized code, fixing tab/spacing errors, and final logic errors.