Added target() function to main program.