adding some math stuff