Added functions and they kind of work.