hasty python implementation of change problem.