Added functiional tests