updated example to use constants, transform matrix and added comments