SMC non working version(revise if needed)