add app and test input
move implementation to cpp file