Fixing minor bugs, adding model functionalities