Stock comparison code.