implemented cloud code