The second apply function is commented out, can that be removed?