finished porting tests to scala