added PIN query, design changes