issue #19 shitty unoptimized code on server side, but works almost as needed