final, checked last time... prolly still has errors, am tired as hell