implemented rating, it works

did some cleaning in files