everything rewritten, still doesn't work :)