homeWork for algorithm