implemented ostream and comparision operators