Added some tests, made most of them pass :)