algorithm finished in homework stage