ported some stuff, no more errors!