Add the ability to manipulate flags. Closes #1