fixed bugs, still doesn't work