added emptyWith and test functions