I dont understand why my while loop does not break when a gets -1.