Replaced string lib usage with str methods