polling for completion of lockin seems to cause problems
adding save to json option
added some saving capabilities