Added more resources and changed the write method