Teaching AI to think ethically