added alts, corrected while statement