some progress, still some bugs though and added some small tests