Temp testing code--needs rewrite