fix cons function bug
Begin to use linked list rather than array