Removed unnecessary results array and fixed minor errors