added the comments and changed the threshold to odd values