sample codes that's helpful