Solving the critical state using flux line properties