started on pair function