New functions added

Code added with comments