modified highlevel code for modelsim