Changed shake function