Finished program. Read commments