added pacman logic