Added delegate and implemented delegate methods