Set up custom flag, created listener

Now in functioning form!