updated according to the standard
default case and a test added