update main functionality