A script to end positions which meet the given criteria