Added error checking and made slight doccumentation update