implement R prototype in python ;)