Concise code for hw1