Added all of the functionality back in from the original