app working better now. still having an off-by-one error