corrected initial errors in code
fixed original probs