Added commenting to is_valid function
Added commenting to save_input function
replaced html span with laravel span
renamed function all_with_popularity to with_ranks
added temp_files_exist function, and temp file checking to upload_temp_files function.