code for occupancy and abundance models