lastButOne xs = if null xs || (length xs) < 2
                then undefined
                else
                  if (length xs) == 2
                  then head xs
                  else lastButOne (tail xs)
