mutable state using refs (scheme uses set!)