Fixed error checking, added tutorial