Initial code
Added tests