algorithms written by python