corrected various incorrectness, works now