Core functionality done
Changed output of getTailNode