made initial changes to support pflags vs flags