working ES2 from scratch