Improved histej and created function to ensure errorbars will stay within a desired limit.
Added new functions.