up to marks code re-writes