Added functions, correct output