Add types to flags,  and add functions for testing flags