making my previous fix more efficient