Fixed bug in my implementation of difference