added first version of templating system; unix error codes