moved stuff from rtodd