tested, added comments