Reimplement [ according to specification

Closes #2