tweaked to make easier for testing