modified test and some cleaning up