Added functions

Added first and second functions to program.