first pass optimization from 10 to 40fps