added test and closing statements