Code for cases 1-4 added

I think I did those right?