flags now works as intended