added sams comments fix and added counting of tokens