Using vb.net command and manual algorithm