debugged and non-decending lower bound
Updated nan issues