Bug fixes & 1 new function