Removed dead weight code. Improved comments