added final functionality