more progress made on bug fixing and type errors