added some math stuff