Bug fixing, still doesn't work though