modified a bit around on modify. This is not yet the final thing though