Moved function directly into library.js

For some reason, some extra stuff was going on when I had it in
downloads