Functional Test

Added a functional test.