 		COMMIT;
 
     END IF;
-	END IF;
-    
+
 END
 //
 

		ROLLBACK;
        SELECT "Amount on the account is not enough to make the transaction.";

	ELSE IF toAccountStatus = null THEN
		ROLLBACK;
        SELECT "Recieving account not found";
    ELSE 

		UPDATE Account 
		SET
			balance = balance + percAmount
		WHERE
			accountNr = toaccountnr;

		UPDATE Account 
		SET
			balance = balance - amount
		WHERE
			accountNr = fromaccountnr;
		
        UPDATE Bank
		SET
			balance = balance + (amount - percAmount)

	DECLARE currentBalance NUMERIC(4, 2);
    DECLARE toAccountStatus NUMERIC(4, 2);
    DECLARE percAmount DECIMAL(7,2);

    START TRANSACTION;

    SET toAccountStatus = (SELECT balance FROM Account WHERE accountId LIKE toaccountnr);
	SET currentBalance = (SELECT balance FROM Account WHERE accountId LIKE fromaccountnr);
    SET percAmount = amount * 0.97;
