Cleaned style. Added tests.