Updated docs, removed uncessary imports, reformating of code and chained exception