fully working in modelsim