slightly better lab1 solution, thanks to your fellow student Amentha Rajagobal