use splice() instead of read-write method