Changed to more efficient way