Homework program1 by Ivailo Ivanov