almost complete but did't work on the whole data