Add Riccardo's Tests
Add Riccardo's Test. Code readibility slightly improved; minor performance improvements.