fixed incorrectly "optimized" method