refactored, working movie rating code