added JOIN to prefers function
added UPDATE function to ratings