now basic function working