Finished but I think there is a bug in tests... oh well.