Add comments and fix validation