My solution the programming assignment