new implementation of two degrees of freedom