first working protototype with brute force