bunch of changes, hope this doesn't break stuff
yeah I should check to make sure we have the file before trying to read it
yeaahhh references
half-assed fix