finished support for primary keys