Seperated local code from main mass-spec code

This should make life much easier when updating the ms-code
in the future.