ported many of the functions to the new rep