improvement of first homework assignment