Borrowed a few things back from Jamie's versions