finished implementation of << operator