modified code to use pragma for