copy of norvig's simple scheme in python