Add comments / Resolve Buffer Overflow

Add comments
resolve buffer overflow in getData Function