Python algoritm prototyping