changed following Dima's comments

Final version, hopefully