SUBMIT ALGORITHM