added core model and improved optknock script