Created two IIPE functions in js