Algorithm solution for space-fractional diffusion equations