Fixed bug with copy (not setting target to 0 first) and ifEqual (overwriting value at indexB, which should be read-only).
Implemented while function, renamed input to getchar.