using objects and alert