Contains both Ebi and Tyler's changes