merge of shock code

Thanks for the inline comment