changed portindex increment and mouse threshold value