renamed observe function to transform