messing around with random and function mapping
added in tournament selection