Removed unused code. Added comments.