added basic controller and copied gearanalysislib from prototype