optimizations
added sign tracking