Initial parameters changed
tabs, div function, extended euclidean algorithm

tabs replaced by spaces
integer division function added
brute force inv replaced by extended euclidean algorithm