Added basic error checking, abstracted the downloading part for both functions/files, removed modeline