Started making ported code work