Initial implementation
Added tests