Some slight modificatiosn