Added difference function and accessors

It probably definitely doesn't work as is. Will work on debugging later.