updated partial application code