functional, but slow and buggy