Magnetic flux ropes in 3-dimensional MHD simulations