function [W, H] = nmf(V, K, W, H, update)

    [F, T] = size(V);
    
    if nargin < 3, W = rand(F, K); end
    if nargin < 4, H = rand(K, T); end
    if nargin < 5, update = 1:K; end
    
    for iter=1:50
        
        % TODO: update for H (add eps to denominator for stability)
        H = H;
        
        % TODO: update for W (only update columns in "update", add eps to denominator)
        W(:, update) = W(:, update);
        
    end