fixed emit for compare. also, vm has separate write method now