Why do Venus and Uranus spin upside down?

Venus and Uranus spin awkwardly compared to the other planets in the solar system.

It all comes down to when the solar system and the planets were formed, they were averagely hit at a certain angle causing Venus to rotate in reverse axis and Uranus to rotate on it side axis.