Split the code, use preconditions, use rather plain language for function names and add comments where it is not totally obvious, what the code is supposed to do.
Split the code, use preconditions, use rather plain language for function names and add comments where it is not totally obvious, what the code is supposed to do.