Added comments and more debug statements