Add lastID helper function
D2 Functional Testing