Implementation for #2 done. Now fighting with tests.