* fixing off-by-one error
 * misc cosmetic changes