changed core code around