finished the program from the online tutorial part 2