Added code to functions, needs data structure still