v1.0, functioning, needs pythonification