sort of working, there are definitely bugs