Update comments, make range ends exclusive, add more testing