forgot periods
adding the math stuffs
added guarded function clauses