added apache licensing/removed implicit double<->float conversions/addressed style guide issues