fixing a regex that was matchig accross too many lines. test cases added
more tests for the implicit functions
minor formatting changes