lots of changes but still doesn't work totally