added comments, renamed some stuff