Assignment done

Added function body and comments