Optimized code

No sort no list, no classes... ready to be 6809ized ;)