Added remove instances method which changes the given object