handled -ve special cases. clarified many comments.