Added an id() method and used the inTransaction() method rather than tracking it on my own.