Added docstring to def (instead of comments)

And also cleaned up some unnecessary remainings