wayyyyy cleaner, now to fix the scope variables