An Innovative Algorithm for Cast Detection