Updated winner takes all code to use a limit