my implementation of the exercise of UFLDF