The origin, structure and evolution of sunspots are investigated using a numerical model. The compressible MHD equations are solved with physical parameter values that approximate the top layer of the solar convection zone. A three dimensional (3D) numerical code is used to solve the set of equations in cylindrical geometry, with the numerical domain in the form of a wedge. The linear evolution of the 3D solution is studied by perturbing an axisymmetric solution in the azimuthal direction. Steady and oscillating linear modes are obtained.