updates to intermediate functions