Added more and better comments for clarity