got basic function working