resolved prototype and random pointer errors