Modified to only edit binary threshold