implementation of insert, insertAll. unit tests + small bug fixes