removed `function` keyword for maximum portability

Reference: http://mywiki.wooledge.org/BashPitfalls#function_foo.28.29