bug fixes and added len() call to tutorial