Prepare "calculator" function