less bugs, syntax errors fixed,var names corrected