cleaned up off by one errors