Added tests, hopefully I did it right