Added allowed extensions for movies to detect. Improved code to reduce indentations.