Implemented dif function in the server model