private void findCosineSimilarity(int[] activeUser) {          // Add Logic to check that not all elements are same otherwise Wau =0 
         
        for (int user = 0; user < totalUsers; user++) {
            double innerProduct = 0;
            double lengthOfActiveUser = 1;
            double lengthofUser = 1;

           


            for (int movie = 0; movie < totalMovies; movie++) {

                if (activeUser[movie] > 0 && ratings[user][movie] > 0) {  //(activeUser[movie] - activeUserAverage) add logic to rectify this to be 0


                    innerProduct += (activeUser[movie] - activeUserAverage) * (ratings[user][movie] - averageOfUser[user]);
                    lengthOfActiveUser += Math.pow((activeUser[movie] - activeUserAverage), 2);
                    lengthofUser += Math.pow((ratings[user][movie] - averageOfUser[user]), 2);
                }
            }

            similarity[user] = innerProduct / (Math.sqrt(lengthOfActiveUser) * Math.sqrt(lengthofUser));
            if(similarity[user]==0&&(isElementAverageInActiveUser(activeUser)||isElementAverage(user))){
                similarity[user]=cosineSimilarity(user, activeUser);
            }                                  
        }
        sortUsers();
    }