Adding ported code