public ValueType top() throws NotExistException {
        if (amount != 0) {
            return head.value;
        } else {
            throw new NotExistException("Stack is empty!");
        }
    }