Rewrite getData according to what Cyerus and Soban suggested