working prototype ready for algorithm