Sorted map filter calsim

Addesses everthing but the optional parameters in #173