slight modificatios