fixing off-by-one error for bottom alignment