updated based on PR comments + new str func for program