Refactored with vectors
Update log for problem 29