changed some listeners, and made a beginning of flags