fix multiple bugs and implement nopars