add method to build primary keys