how is a river formed