adding code from HW#2 - manipulator and VIE