Modified things
Added robustness test code