Writing increasingly ridiculous lines of code due to not handling integer NaN values. Going to have to do a big refactor soon.

updated: