wrote some functional test