The character of Buck Mulligan was based on Joyce's acquaintance Oliver St. John Gogarty. Gogarty was a medical student, swimmer, poet and wit. Joyce lodged with Gogarty in a Martello Tower for a time, which episode forms the basis for the opening chapter of Ulysses. Visitors to Dublin may visit a tourist-oriented pub named after Gogarty in the Temple Bar area.