added first function and documentation to s138