Updated UDFs and created some unitary tests