Added str mode and some comments