some crazy lorin code
tmp
merge with brian branch