TODO: fix the noted under by one bug