final changes, added comments