added some comments. added errors to calling