Simplifying the functions a bit
Added a Python hard_limit() function