wrote and tested the defix method