added comments for easier reading