Comments added
Performance improvement: Use an object instead of an array to store data