Added some documentation and removed sample bugs