Finish off logic for programming phase