Removed obsolete code and added docstring