Added threshold based comparison