commented and improved