working (hacky) first implementation