porting to factorie, more code