my own homework codes and official solution