Added proper comments for functions