added math, fixes, etc