Defined each var and calculations