note that it was written in python