FIX: memory leak
FIX: took wrong number of variables