Algorithm for Movie Database