Fixed some mistakes and added undiscussed cases