Tesla shocks the market and turns a profit