Thesis related code