Oakhurst man gets 40 years in prison