STR added. Some minor refactoring.