successfully compile the code.. added different cases