changed a few functions