first significant progress; still buggy as hell... :)