solved the Programming Assignment