wrote onclick functions