v2

2nd version, without class just function