Multifunctional polymers for sensing applications