still trying to eliminate loop