added simple prior gen
some reorganization