Attempted to merge in SableDnah's changes