better formatting and docstring for code readability