Had to move random to fix implicit error