Made congregation_index into a function.