Now it scales ok, might need more corrections