Finish primary function