updates to thesis rcode