Directed and elliptic flows in heavy ion collisions at intermediate energies