Create rating engine code

Ethan - please review and comment.