More comments and better code