added more comments, enabled debug to be turned off
show debug toggle