These animals were carnivorous, relying less on vegetation for food, it caught it's prey by stealth. In fact, at first all whales were killers. Ambulocetus was a rather slow swimmer, more like sea otters than like modern whales or dolphins. After Ambulocetus was an almost fully aquatic creature known as Rodhocetus. Though it was much more aquatic than Ambulocetus, it still retreated to land. Why is anybody's guess. Probably to bask in the sun or to supplement their diet with small land animals. It was believed, like Ambulocetus, to swim in a rather otter-like fashion. It is however, much more whale-like than it's earlier predecessors.
About 30 million years ago or so, these animals lost their legs and became another very whale-like animal known as Basilosaurus. Basilosaurus was a huge, serpentine whale that inhabited the ancient Tethys sea. Often, these animals still swam up to estuaries to hunt bathing animals. They were scary-looking, with a head much life a shark with crushing jaws and sharp teeth.
This animal was first thought to be a giant lizard, but further studies have pinpointed it as the closest relatives to dolphins. As you can see, they still have remnants of their back legs, but they are greatly reduced and almost useless for all but to steady the females for mating. No modern whale has this, although a bottlenose dolphin, who was a freak of nature was spotted in 2006 that still had hind flippers similar to these. But it was just one animal with some kind of genetic mutation. Indeed embryonic dolphins still have the rear flippers, but these disappear later on in their development.