change line ending and ignored swap files
add docstring and formatted by pylint