Added some bookkeeping functions