Some improvements, some new functions