Remove unused arrays
Remove unnecesary bsr functions
Add references to original implementations