moved and modified simple example to write leapfrog steps to file