main block working