I'm working on a prolog problem where I have an input list of positive, negative and "0" numbers. I have to create and then output another list in relation to the first where each positive, negative and "0" number is replaced with a "1", "-1", and "0" respectively. 

I have started on something that accepts a list and then replaces each element that is positive then negative and then "0" but I don't think it is working correctly. 

```
replace(_, _, [], []).
replace(O, 1, [O|T], [1|T2]) :- H = 1 replace(O, 1, T, T2).
replace(O, -1, [O|T], [-1|T2]) :- H = -1 replace(O, -1, T, T2).
replace(O, 1, [O|T], [0|T2]) :- H = 0 replace(O, 0, T, T2).

```

Thanks for any help!