should work now
found one bug