added new test functions, changed some structures