works now for small data
will cause problem when running for big data
has memory issue