Added file size checking, non-western character support and commenting for the entire script.