Updated copyright info to make it clear that this is a modification. Also cleaned up some redundant logical statements.