functional prototype + simple tests