Completed sorter functions. Can now check sorting network for validity.