removed psudo code helpers