changed implementation of concat() method