added bufferloader.js file still needs refactoring