here is the "magical" code josh