changed y threshold and added y threshold