some small changes + optional restrictions on the analysis