Add bug5&6

Add bug5&6 based on professor's suggestion.