added comments, validation fix