Added functions

also made a debugged in program.cs