compiles with CCS, uses external xtal correctly and some improvements