implemented toStrBar function