added nelmin and bug fixes