Added encounter generator function