Fixes instance errors, adds class function