Changed list to object and added closing system