Alternative method needs debugging. Also, slow.