basically works now, unittests are needed and further testing