Improvements for assignment 1