simple ruby mathmatical computation