Added documentation and removed unrequired code.