Updating core code based on work done for lookingforpullrequests.com