Corrected looping issue, FMS now runs for specified number of loops.