You have two variables that aren't actually needed. * **newNode:** when inserting smaller than first * **prevTmp:** when inserting after while. Can be tmpNode