Lots of changes; clean up the redundancy; work on zero division errors