IDS homework for CS487