2 functions implemented comments added