introduced CPT structure and refactored implementation to use it. Renamed potential at node creation to potential-rhs to make its meaning clearer. Introduced parameters to replace magic numbers in the code.