fixing core parts, updating tests