Added init function
Added error function w/ documentation